﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TestFYP
{
    public class Counters
    {
        //80.23209774
        public Microsoft.Office.Interop.Word.Range range { get; set; } 
        public int punc_comma { get; set; }
        public int punc_period { get; set; }
        public int punc_question { get; set; }
        public int punc_semicolon { get; set; }
        public int punc_colon { get; set; }
        public int punc_invertcomma { get; set; }
        public int punc_OpenBracket { get; set; }
        public int punc_CloseBracket { get; set; }
        public int punc_exclamation { get; set; }
        public int[] graph_atoz  = new int[26];
        public int[] graph_AtoZ = new int[26];
        public Double Total { get; set; }
        public String title { get; set; }
        public Double WordCount { get; set; }

        public int this[int atozindex]
        {
            get
            {
                return graph_atoz[atozindex];
                return graph_AtoZ[atozindex];
                
            }

            set
            {
                graph_atoz[atozindex] = value;
                graph_AtoZ[atozindex] = value;
                
            }
            
        }



        public void setTotal() 
        {
            //Console.WriteLine(punc_CloseBracket);
            //Console.WriteLine(punc_colon);
            //Console.WriteLine(punc_comma);
            //Console.WriteLine(punc_exclamation);
            //Console.WriteLine(punc_invertcomma);
            //Console.WriteLine(punc_OpenBracket);
            //Console.WriteLine(punc_period);
            //Console.WriteLine(punc_question);
            //Console.WriteLine(punc_semicolon);
            Total = 0;
            Total += punc_CloseBracket / WordCount;
            Total += punc_colon / WordCount;
            Total += punc_comma / WordCount;
            Total += punc_exclamation / WordCount;
            Total += punc_invertcomma / WordCount;
            Total += punc_OpenBracket / WordCount;
            Total += punc_period / WordCount;
            Total += punc_question / WordCount;
            Total += punc_semicolon / WordCount;
            //foreach (int atoz in graph_atoz)
            //    Total += atoz / WordCount;
            //foreach (int AtoZ in graph_AtoZ)
            //    Total += AtoZ / WordCount;
        }




        public Counters(Microsoft.Office.Interop.Word.Range range,String title)
        {
            this.range = range;
            WordCount = range.ComputeStatistics(Microsoft.Office.Interop.Word.WdStatistic.wdStatisticWords);
            this.title = title;
        }
    }
}
